$(() => {
  $('.layui-form').submit(function (e) {
    e.preventDefault();
    let pwd = $(this).serialize();
    $.ajax({
      type: 'POST',
      url: '/my/updatepwd',
      data: pwd,
      success(res) {
        layer.msg(res.message, function () {
          if (res.status == 0) {
            $('button[type="reset"]').click();
            window.parent.location.href = '/bigevent/home/login.html';
            localStorage.removeItem('token');
          }
        });
      },
    });
  });
});
